%%
%% This is file `kulemtx.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% kulemtx.dtx  (with options: `style')
%% 
%% This is a generated file.
%% 
%% Copyright (C) 2010 by Luc Van Eycken <Luc.VanEycken@esat.kuleuven.be>
%% 
%% This file may be distributed and/or modified under the conditions of
%% the LaTeX Project Public License, either version 1.2 of this license
%% or (at your option) any later version.  The latest version of this
%% license is in:
%% 
%%    http://www.latex-project.org/lppl.txt
%% 
%% and version 1.2 or later is part of all distributions of LaTeX version
%% 1999/12/01 or later.
%% 
\NeedsTeXFormat{LaTeX2e}[2001/06/01]
\ProvidesPackage{kulemtx}
    [2010/02/28 v0.1
     Additions to the kulemt document class]
\newsavebox\kulemtx@chpnumbox
\def\kulemtx@buildchpnum#1#2{\sbox\kulemtx@chpnumbox{%
    \tabular[t]{@{}c@{}}%
      \makebox[0pt][c]{\chapnamefont #1\strut}\\[.5ex]%
      \colorbox[gray]{.8}{\color{black}%
        \rule[-7em]{0pt}{0pt}%
        {\chapnumfont \hspace{.7ex}#2\hspace{.7ex}\strut}}%
    \endtabular}}
\makechapterstyle{kulemtman}{%
  \def\chapnamefont{\sffamily\large}%
  \def\chapnumfont{\sffamily\Huge}%
  \def\chaptitlefont{\sffamily\raggedright\huge}%
  \setlength\beforechapskip\z@skip
  \setlength\midchapskip{29\p@}%
  \setlength\afterchapskip{40\p@}%
  \def\printchaptername{}%
  \def\chapternamenum{}%
  \def\afterchapternum{}%
  \def\printchapternum{%
    \kulemtx@buildchpnum\@chapapp\thechapter}%
  \def\printchapternonum{%
    \kulemtx@buildchpnum{\vphantom{\@chapapp}}{\hphantom{\thechapter}}}%
  \def\printchaptertitle##1{%
    \usebox\kulemtx@chpnumbox \hfill
    \@tempdima\hsize  \advance\@tempdima -1em%
    \advance\@tempdima -\wd\kulemtx@chpnumbox
    \parbox[t]\@tempdima{\vspace\midchapskip
      \leavevmode \leaders\hrule\@height\p@ \hfill \kern\z@ \par
      \chaptitlefont ##1\par}}}
\makeheadstyles{kulemtman}{%
  \def\partnamefont{\normalfont\huge\sffamily}%
  \def\partnumfont{\normalfont\huge\sffamily}%
  \def\parttitlefont{\normalfont\Huge\sffamily}%
  \chapterstyle{kulemtman}%
  \setsecheadstyle{\Large\sffamily\raggedright}%
  \setsubsecheadstyle{\large\sffamily\raggedright}%
  \setsubsubsecheadstyle{\large\sffamily\itshape\raggedright}%
  \setparaheadstyle{\normalsize\scshape}%
  \setbeforeparaskip{\medskipamount}}
\newcommand*\kulemtmanToC{%
  \let\cftchapterfont\sffamily
  \let\cftchapterdotsep\cftdotsep
  \def\cftchapterleader{\normalfont\cftdotfill{\cftchapterdotsep}}%
  \def\cftchapterpagefont{}%
  \setlength\cftbeforechapterskip{\medskipamount}%
  \setlength\cftbeforesectionskip{\smallskipamount}%
  \settocdepth{subsection}%
  \addtodef\cftchapterbreak{\par}{}%
  \let\cftsubsectionfont\itshape
  \def\l@subsection##1##2{%
    \leftskip\cftsubsectionindent \rightskip\@tocrmarg \parfillskip\fill
    \ifhmode ,\quad \else\noindent\fi \ignorespaces
    {\let\numberline\@gobble \cftsubsectionfont ##1}%
    ~~{\cftsubsectionpagefont ##2}\ignorespaces}}
\endinput
%%
%% End of file `kulemtx.sty'.
